

// 尺寸自适应方法，设计稿宽度750px
(function (width) {
    var doc = width.document,
        element = doc.documentElement,
        i = 750,
        d = i / 100,
        o = "orientationchange" in width ? "orientationchange" : "resize",
        a = function () {
            var width = element.clientWidth || 320;
            width > 750 && (width = 750);
            element.style.fontSize = width / d + "px"
        };
    doc.addEventListener && (width.addEventListener(o, a, !1), doc.addEventListener("DOMContentLoaded", a, !1))
})(window);

// 禁用缩放
function addMeta() {
    $('head').append('<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />');
}
setTimeout(addMeta, 3000);

// 禁用双指放大
document.documentElement.addEventListener('touchstart', function (event) {
    if (event.touches.length > 1) {
        event.preventDefault();
    }
}, false);

// 禁用双击放大
var lastTouchEnd = 0;
document.documentElement.addEventListener('touchend', function (event) {
    var now = Date.now();
    if (now - lastTouchEnd <= 300) {
        event.preventDefault();
    }
    lastTouchEnd = now;
}, false);


